export default class Bubble extends Laya.Script{
    change:boolean = true
	constructor(){
        super();

        Laya.timer.once(500,this,this.upward);
        Laya.stage.timerLoop(1000,this,this.changImg)
    }

   
    upward(){
        console.log(this);
        Laya.timer.frameLoop(1,this,()=>{
            // console.log(this);
            this.owner.top+=5;
            if(this.owner.top>=1920){
                this.owner.top=-1920;
            }
        })
    }

    changImg(){
        if(this.change){
            this.owner.skin = "images/bg3.png"
            console.log("change")
            this.change = false
        }else{
            this.owner.skin = "images/bg2.png"
            this.change = true
            console.log("Nochange")
        }
    }
    
}